﻿using System.Runtime.Serialization;

namespace StreetPacMan.Server.Facade
{
    [DataContract]
    public class GetGameStateResult
    {
        public GetGameStateResult(GameState state, int score, string lastGameMessage, PlayerDescription[] players, ClientApple[] apples, Geo[] gameBorderPoints)
        {
            State = state;
            Score = score;
            LastGameMessage = lastGameMessage;
            Players = players;
            Apples = apples;
            GameBorderPoints = gameBorderPoints;
        }


        [DataMember]
        public GameState State { get; private set; }

        [DataMember]
        public int Score { get; private set; }

        [DataMember]
        public string LastGameMessage { get; private set; }

        [DataMember]
        public PlayerDescription[] Players { get; set; }

        [DataMember]
        public ClientApple[] Apples { get; private set; }

        [DataMember]
        public Geo[] GameBorderPoints { get; private set; }
    }

    [DataContract]
    public class PlayerDescription
    {
        [DataMember]
        public string Name { get; private set; }
        [DataMember]
        public PlayerRole Role { get; private set; }

        public PlayerDescription(string name, PlayerRole role)
        {
            Name = name;
            Role = role;
        }
    }
}